
import time
import random
from PyQt4 import QtCore


class LogThread(QtCore.QThread):
    trigger = QtCore.pyqtSignal(int)

    def __init__(self, parent=None):
        super(LogThread, self).__init__(parent)

    def setup(self, message):
        self.message = message

    def run(self):
        time.sleep(random.random() * 5)  # random sleep to imitate working
        self.trigger.emit(self.message)
